# -*- coding: utf-8 -*-
# @Time : 2022/8/30 下午2:22
# @Author : WangYunfei
# @FileName: down.py
# @Email: yunfei.wang@innvote.com
import requests


if __name__ == '__main__':
    # url_list = [
    #     "https://pic.netbian.com/uploads/allimg/220211/004115-1644511275bc26.jpg",
    #     "https://pic.netbian.com/uploads/allimg/220215/233510-16449393101c46.jpg",
    #     "https://pic.netbian.com/uploads/allimg/211120/005250-1637340770807b.jpg",
    # ]
    # save_images(url_list)
    with open("account") as f:
        data = f.readlines()
    for i in data:
        i = i.rstrip()
        name = i.rsplit("	")[0]
        url = "http://jitpc.jit.edu.cn/static/DM" + i.rsplit("	")[1]
        print(name, url)
        with open(f"./image/{name}.jpeg", "wb") as img:
            req = requests.get(url)
            img.write(req.content)
